<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>员工列表</title>
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script>
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <style>
  </style>
</head>
<body>
<div id="app">
  <div v-for="employee in employees" style="width: 200px; height: 200px; background-color: red; margin-bottom: 10px">
    <div>{{employee.name}}</div>
    <div>{{employee.gender}}</div>
    <div>{{employee.age}}</div>
    <div>{{employee.hire_date}}</div>
    <img :src="employee.avatar"  alt="some_text" width="100px">
  </div>
</div>
</body>
<script>
  new Vue({
    el: '#app',
    data: {
      employees: []
    },
    mounted(){
      axios
              .get('/employee/selectAll')
              .then(response => (this.employees = response.data))
              .catch(function (error) { // 请求失败处理
                console.log(error);
              });
    }
  });
</script>
</html>